﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NTLib.Pipe.UTest.TestData;
using NTLib.Pipe.Containers;
using NTLib.Pipe.Targets;
using System.Diagnostics;
using NTLib.Pipe.Exceptions;
using NTLib.Core.Pool;
using System.Threading;
using System.Threading.Tasks;
using NTLib.Pipe.Descriptors;

namespace NTLib.Pipe.UTest.Containers
{
    [TestClass]
    public class MemoryPipeSourceUTest
    {
        #region Fields

        private const string CATEGORY = "Pipe.Source";
        private readonly PipeSourceUTest<MemoryPipeSource<DataStruct>> _tester = new PipeSourceUTest<MemoryPipeSource<DataStruct>>();

        #endregion

        [TestCategory(CATEGORY)]
        [TestMethod]
        public void MemoryPipeSource_CreationAndDispose()
        {
            this._tester.PipeSource_CreateAndDispose();
        }

        [TestCategory(CATEGORY)]
        [TestMethod]
        public void MemoryPipeSource_CreationAndInit()
        {
            this._tester.PipeSource_CreationAndInit(LocalTargetDescription.Instance);
        }

        [TestCategory(CATEGORY)]
        [TestMethod]
        public void MemoryPipe_PoolCreationAndStatus()
        {
            this._tester.PipeSource_PoolCreationAndStatus();
        }

        //[TestCategory(CATEGORY)]
        //[TestMethod]
        //public void MemoryPipe_PushAndPop()
        //{
        //    this._tester.PipeSource_PushAndPop(LocalTargetDescription.Instance);
        //}

        //[TestCategory(CATEGORY)]
        //[TestMethod]
        //public void MemoryPipe_PushAndPop_WithCancel()
        //{
        //    this._tester.PipeSource_PushAndPop_WithCancel(LocalTargetDescription.Instance);
        //}


        [TestCategory(CATEGORY)]
        [TestMethod]
        public void MemoryPipe_SendAndPop()
        {
            this._tester.PipeSource_SendAndPop(LocalTargetDescription.Instance);
        }
    }
}
